/*
 * @Description: 流量主
 * @Author: iamsmiling
 * @Date: 2021-06-06 10:53:04
 * @LastEditTime: 2021-06-09 22:57:23
 */

import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/components/modal/city_picker_modal.dart';
import 'package:credit_business_circle/pages/publish_square/children/publish_center/dialog/show_settlement_mode_demo_dialog.dart';
import 'package:credit_business_circle/pages/publish_square/children/publish_center/publish_center_controller.dart';
import 'package:credit_business_circle/pages/publish_square/children/publish_center/widget/selector_text_field.dart';
import 'package:credit_business_circle/routes/app_routes.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class PlatFormFormCard extends StatelessWidget {
  final PublishCenterController controller;
  const PlatFormFormCard({Key? key, required this.controller})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.all(R.dimen.dp10),
      padding: EdgeInsets.fromLTRB(R.dimen.dp10, R.dimen.dp10, R.dimen.dp10, 0),
      decoration: BoxDecoration(
          color: R.color.ffffffff,
          borderRadius: BorderRadius.circular(R.dimen.sp5)),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SelectorTextField(
            label: "所属行业",
            onTap: () => (Get.toNamed(AppRoutes.industry) as Future<String?>?)
                ?.then((value) {
              print(value);
            }),
          ),
          SelectorTextField(
              label: "合作地区", onTap: () => showCityPicker(context)),
          SelectorTextField(
            label: "流量要求",
            showDemo: () {},
            onTap: () => Future.value(),
          ),
          SelectorTextField(
              label: "结算方式",
              showDemo: () => showSettlementModeDemoDialog(context)
              // onTap: () => showSettlementModeDemoDialog(context),
              ),
          SelectorTextField(
            label: "结算周期",
            onTap: () => Future.value(),
          ),
          SelectorTextField(
            label: "有效时间",
            hintText: "2021-07-08(到期后信息会自动下架)",
            dividerColor: R.color.transparent,
          )
        ],
      ),
    );
  }
}
